package com.ruoyi.community.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.OwnerMapper;
import com.ruoyi.community.domain.Owner;
import com.ruoyi.community.service.IOwnerService;

/**
 * 业主 Service业务层处理
 * 
 * @author Sea
 * @date 2025-01-02
 */
@Service
public class OwnerServiceImpl implements IOwnerService 
{
    @Autowired
    private OwnerMapper ownerMapper;

    /**
     * 查询业主 
     * 
     * @param ownerId 业主 主键
     * @return 业主 
     */
    @Override
    public Owner selectOwnerByOwnerId(Long ownerId)
    {
        return ownerMapper.selectOwnerByOwnerId(ownerId);
    }

    /**
     * 查询业主 列表
     * 
     * @param owner 业主 
     * @return 业主 
     */
    @Override
    public List<Owner> selectOwnerList(Owner owner)
    {
        return ownerMapper.selectOwnerList(owner);
    }

    /**
     * 新增业主 
     * 
     * @param owner 业主 
     * @return 结果
     */
    @Override
    public int insertOwner(Owner owner)
    {
        owner.setCreateTime(DateUtils.getNowDate());
        return ownerMapper.insertOwner(owner);
    }

    /**
     * 修改业主 
     * 
     * @param owner 业主 
     * @return 结果
     */
    @Override
    public int updateOwner(Owner owner)
    {
        owner.setUpdateTime(DateUtils.getNowDate());
        return ownerMapper.updateOwner(owner);
    }

    /**
     * 批量删除业主 
     * 
     * @param ownerIds 需要删除的业主 主键
     * @return 结果
     */
    @Override
    public int deleteOwnerByOwnerIds(Long[] ownerIds)
    {
        return ownerMapper.deleteOwnerByOwnerIds(ownerIds);
    }

    /**
     * 删除业主 信息
     * 
     * @param ownerId 业主 主键
     * @return 结果
     */
    @Override
    public int deleteOwnerByOwnerId(Long ownerId)
    {
        return ownerMapper.deleteOwnerByOwnerId(ownerId);
    }
}
